/**
 * 
 */
package SimulLois;

import org.apache.log4j.Logger;

import SimulLois.interfaces.Lois;

/**
 * @author Propriétaire
 * 
 */
public class Uniforme implements Lois {
	
	public static Logger	LOG	= Logger.getLogger(Uniforme.class);
	
	private Double	     low	= new Double(0.0);
	
	private Double	     up	    = new Double(0.0);
	
	public Uniforme(Double low, Double up) {
		this.low = low;
		this.up = up;
	}
	
	public static Double randUniforme() {
		
		return Math.random();
	}
	
	public static Double randUniforme(Double low, Double up) {
		
		return (Math.random() * (up - low)) + low;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see main.java.SimulLois.interfaces.Lois#gen()
	 */
	@Override
	public Double gen() {
		// TODO Auto-generated method stub
		return randUniforme(low, up);
	}
	
	/**
	 * @return the low
	 */
	public Double getLow() {
		return low;
	}
	
	/**
	 * @param low
	 *            the low to set
	 */
	public void setLow(Double low) {
		this.low = low;
	}
	
	/**
	 * @return the up
	 */
	public Double getUp() {
		return up;
	}
	
	/**
	 * @param up
	 *            the up to set
	 */
	public void setUp(Double up) {
		this.up = up;
	}
	
}
